<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page import="com.meichaoit.entity.Account"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>ATM WEB</title>
    <script type="text/javascript">
    
    <%
    	Account me = (Account)session.getAttribute("account");
    %>
			function check(){
				if(document.myform.oldpwd.value!=<%=me.getPassword()%>){
					document.getElementById("span1").style.display="block";
				}else if(document.myform.newpwd.value!=document.myform.cnewpwd.value){
					document.getElementById("span2").style.display="block";
				}else{
					document.myform.submit();
				}
				
			}
	</script>	
  </head>
  
  <body>
    <h2>ATM WEB 修改密码</h2>
    
    <form action="l_change.jsp" method="post" name="myform">
    	原密码:<input type="password" name="oldpwd"><span id="span1" style="color:red;display:none;">请输入正确的密码</span><br/>
    	新密码:<input type="password" name="newpwd"><br/>
    	确认新密码:<input type="password" name="cnewpwd"><span id="span2" style="color:red;display:none;">您两次输入的密码不一样！请重新输入</span><br/>
    	<input type="button" value="保存" onclick="check()">  
    </form>
  </body>
</html>
